@use 'sass:map';

$fontNormal: (
  name: normal,
  value: 1
);
$fontBig: (
  name: big,
  value: 1.4
);
$fontLarge: (
  name: large,
  value: 1.6
);
$fontSizeMapping: ($fontNormal, $fontBig, $fontLarge);

/* 动态生成字体大小 by shw */
@mixin fxDynamicFontSize($size, $important: false) {
	$font-size-important: if($important, !important, null);
	
	font-size: $size * map.get($fontNormal, value) $font-size-important;

    @each $item in $fontSizeMapping {
		$font-size-type: map.get($item, name);

		[data-font-size-type="#{$font-size-type}"] & {
			font-size: $size * map.get($item, value) $font-size-important;
		}
    }
}